package battlezone;

import javax.swing.*;

public class Main {

    public static void main(String[] args) {
        //get the last bit of configuration information
        String playerName = (String)JOptionPane.showInputDialog(null, "What is your name?", "Battlezone", JOptionPane.QUESTION_MESSAGE, null, null, System.getProperty("user.name"));
        if (playerName != null) {
            Configuration.getInstance().setPlayerName(playerName);
        } else {
            return;
        }
        
        //create and assemble the objects
        Model model = new Model();
        View view = new View();
        Controller controller = new Controller();
        Network network = new Network();
        model.setNetwork(network);
        model.setView(view);
        view.setController(controller);
        controller.setModel(model);
        
        //for debugging, add a bunch of enemy tanks at random locations
        //model.addObject("test", new Tank(0, 0, 0));
        /*for (Integer i = 0; i < 1000; i += 10) {
            model.addObject("test" + i, new Tank(i, i, i));
        }*/
        model.spawnMyTank(); //and we're off!
    }
}